Sum of Divisors

Introduction

What Are Divisors?

Finding Divisors of a Number

A simple method:

  1. Start at $1$ and test each whole number up to $n$.
  2. If it divides evenly, record it.
  3. Stop when you reach $n$.

A more efficient method:

Example for $36$:

Patterns in Divisors

Some useful observations:

These patterns help us predict divisor behavior without listing everything.

Adding Up Divisors: First Examples

Let’s add all the divisors of a number.

This process leads naturally to a function that captures this idea.

Defining the Sum‑of‑Divisors Function, $\sigma(n)$

Examples:

A formal definition: $$\sigma(n) = \sum_{\substack{d \mid n}} d$$ This means “add all $d$ such that $d$ divides $n$.”

Redefining $\sigma(n)$ using prime factorization

The formula for $\sigma(n)$ becomes especially nice when we use the prime factorization of $n$.

If $$n = p_1^{a_1} p_2^{a_2} \cdots p_k^{a_k},$$ then $$\sigma(n) = (1 + p_1 + p_1^2 + \cdots + p_1^{a_1}) \cdots (1 + p_k + p_k^2 + \cdots + p_k^{a_k}).$$ Why this works (intuitively):

Example:

Matches our earlier calculation.

Properties of $\sigma(n)$

Some helpful facts:

Prime Numbers and $\sigma(n)$

This makes primes and prime powers especially easy to work with.

Perfect, Abundant, and Deficient Numbers

These classifications compare $\sigma(n)$ to $n$ itself.

These categories reveal interesting structure in the integers.

Why $\sigma(n)$ Matters in Number Theory

Calculator

divisors(n)

  • Returns a list of all positive divisors of $n$.
divisors(12) divisors(18)

sumDivisors(n)

  • Returns the sum of all positive divisors of $n$ (the function $\sigma(n)$).
sumDivisors(12) sumDivisors(18)

sumProperDivisors(n)

  • Returns the sum of all proper divisors of $n$ (all divisors except $n$ itself).
sumProperDivisors(12) sumProperDivisors(18)

numDivisors(n)

  • Returns the number of positive divisors of $n$.
numDivisors(12) numDivisors(18)

Exercises

  1. List all divisors of $18$ and compute $\sigma(18)$.

    Solution

    Divisors of 18 and $\sigma(18)$

    • Divisors of $18$: $$1, 2, 3, 6, 9, 18$$
    • Sum: $$1 + 2 + 3 + 6 + 9 + 18 = 39$$
    • Answer: $\sigma(18) = 39$
  2. Compute $\sigma(25)$ using both:
    • direct listing
    • the prime‑power formula

    Solution

    $\sigma(25)$ by two methods

    (a) Direct listing

    • Divisors of $25$: $1, 5, 25$
    • Sum: $1 + 5 + 25 = 31$

    (b) Prime‑power formula

    • $$25 = 5^2$$
    • Formula: $$\sigma(5^2) = 1 + 5 + 5^2 = 1 + 5 + 25 = 31$$
    • Answer: $\sigma(25) = 31$
  3. Determine whether $20$ is perfect, abundant, or deficient.

    Solution

    Classify 20 as perfect, abundant, or deficient

    • Divisors of $20$: $1, 2, 4, 5, 10, 20$
    • Sum: $\sigma(20) = 42$
    • Compare: $$2n = 40$$
    • Since $42 > 40$,
      20 is abundant.
  4. Compute $\sigma(2^4)$.

    Solution

    Compute $\sigma(2^4)$

    • Divisors of $2^4$: $1, 2, 4, 8, 16$
    • Sum: $$1 + 2 + 4 + 8 + 16 = 31$$

    Or using the formula: $$\sigma(2^4) = 1 + 2 + 2^2 + 2^3 + 2^4 = 31$$

    • Answer: $\sigma(2^4) = 31$
  5. Find $\sigma(45)$ using prime factorization.

    Solution

    Compute $\sigma(45)$ using prime factorization

    • Factorization: $45 = 3^2 \cdot 5^1$
    • Apply the formula: $$\sigma(45) = (1 + 3 + 9)(1 + 5)$$
    • Compute:

      • $1 + 3 + 9 = 13$
      • $1 + 5 = 6$
    • Multiply: $$13 \cdot 6 = 78$$
    • Answer: $\sigma(45) = 78$
  6. True or false: If $p$ is prime, then $\sigma(p^2) = 1 + p + p^2$.

    Solution

    True or false: $\sigma(p^2) = 1 + p + p^2$

    • For any prime $p$, the divisors of $p^2$ are $1, p, p^2$.
    • Their sum is exactly $1 + p + p^2$.
    • Answer: True.
  7. Compute $\sigma(28)$ and verify that $28$ is a perfect number.

    Solution

    Compute $\sigma(28)$ and verify perfection

    • Divisors of $28$: $$1, 2, 4, 7, 14, 28$$
    • Sum: $$1 + 2 + 4 + 7 + 14 + 28 = 56$$
    • Compare: $$2n = 56$$
    • Since $\sigma(28) = 2 \cdot 28$,
      28 is a perfect number.
  8. Find all divisors of $30$ and classify $30$ as perfect, abundant, or deficient.

    Solution

    Divisors of 30 and classification

    • Divisors of $30$: $$1, 2, 3, 5, 6, 10, 15, 30$$
    • Sum: $$1 + 2 + 3 + 5 + 6 + 10 + 15 + 30 = 72$$
    • Compare: $$2n = 60$$
    • Since $72 > 60$,
      30 is abundant.